﻿@inject IDataCacheService _dataCacheService
@inject NavigationManager NavigationManager


<MDCard Class="pa-3 mb-4" Style="flex-direction: row;">
    <MSpacer></MSpacer>
    <CnGalWebSite.Shared.MasaComponent.App.Layout.TitleCard @ref="homeTitleCard" Min />
     <MSpacer></MSpacer>
     <CnGalWebSite.Shared.MasaComponent.PC.Layout.SwitchThemeModeButton Class="mr-6" />
     <CnGalWebSite.Components.Buttons.MasaButton Tooltip="搜索" Icon="mdi-magnify" Class="mr-6" OnClick="@(()=>NavigationManager.NavigateTo("/search"))" />

     <CnGalWebSite.Shared.MasaComponent.PC.Layout.LoginButton />
</MDCard>

@code {
    CnGalWebSite.Shared.MasaComponent.App.Layout.TitleCard homeTitleCard;

    public void ChangeTitle(string title)
    {
        if (homeTitleCard != null)
        {
            homeTitleCard.ChangeTitle(title);
        }
    }

    public void OnNavSearchClick()
    {
        NavigationManager.NavigateTo("/search");
        
    }
}
